import Layout from '@/layout'
import EmptyLayout from '@/layout/empty'

export default {
    path: '/goodsManage',
    component: Layout,
    redirect: '/goodsManage/list',
    name: 'goodsManage',
    meta: {
        title: '商品管理',
        icon: 'goods-nav-icon'
    },
    children: [
        {
            path: 'list',
            name: 'goodsList',
            component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/goods/index'),
            meta: {
                title: '商品列表',
                sidebar: false,
                activeMenu: '/goodsManage'
            }
        },
        {
            path: 'add',
            component: EmptyLayout,
            redirect: '/goodsManage/add',
            meta: {
                title: '商品列表',
                sidebar: false
            },
            children: [
                {
                    path: '',
                    name: 'goodsAdd',
                    component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/goods/detail'),
                    meta: {
                        title: '新增商品',
                        activeMenu: '/goodsManage'
                    }
                }
            ]
        },
        {
            path: 'edit/:id',
            component: EmptyLayout,
            redirect: '/goodsManage/edit',
            meta: {
                title: '商品列表',
                sidebar: false
            },
            children: [
                {
                    path: '',
                    name: 'goodsEdit',
                    component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/goods/detail'),
                    meta: {
                        title: '编辑商品',
                        activeMenu: '/goodsManage'
                    }
                }
            ]
        },
        {
            path: 'category',
            name: 'goodsCategory',
            component: EmptyLayout,
            redirect: '/category',
            meta: {
                title: '商品分类',
                auth: ['goods_category.browse']
            },
            children: [
                {
                    path: '',
                    component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/category/index'),
                    meta: {
                        title: '商品分类',
                        sidebar: false,
                        breadcrumb: false
                    }
                },
                {
                    path: 'add',
                    name: 'goodsCategoryAdd',
                    component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/category/detail'),
                    meta: {
                        title: '新增商品分类',
                        sidebar: false,
                        activeMenu: '/goodsManage/category'
                    }
                },
                {
                    path: 'edit/:id',
                    name: 'goodsCategoryEdit',
                    component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/category/detail'),
                    meta: {
                        title: '编辑商品分类',
                        sidebar: false,
                        activeMenu: '/goodsManage/category'
                    }
                }
            ]
        },
        {
            path: 'tag',
            name: 'goodsTag',
            component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/tag/index'),
            meta: {
                title: '商品标签',
                auth: ['goods_tag.browse']
            }
        },
        {
            path: 'params',
            name: 'goodsParams',
            component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/params/index'),
            meta: {
                title: '商品参数',
                auth: ['goods_params.browse']
            }
        },
        {
            path: 'specification',
            name: 'goodsSpecification',
            component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/specification/index'),
            meta: {
                title: '商品规格',
                auth: ['goods_specification.browse']
            }
        },
        {
            path: 'brand',
            name: 'goodsBrand',
            component: EmptyLayout,
            redirect: '/brand',
            meta: {
                title: '品牌管理',
                auth: ['goods_brand.browse']
            },
            children: [
                {
                    path: '',
                    component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/brand/index'),
                    meta: {
                        title: '品牌管理',
                        sidebar: false,
                        breadcrumb: false
                    }
                },
                {
                    path: 'add',
                    name: 'goodsBrandAdd',
                    component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/brand/detail'),
                    meta: {
                        title: '新增品牌',
                        sidebar: false,
                        activeMenu: '/goodsManage/brand'
                    }
                },
                {
                    path: 'edit/:id',
                    name: 'goodsBrandEdit',
                    component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/brand/detail'),
                    meta: {
                        title: '编辑品牌',
                        sidebar: false,
                        activeMenu: '/goodsManage/brand'
                    }
                }
            ]
        },
        {
            path: 'resource',
            name: 'goodsResource',
            component: () => import(/* webpackChunkName: 'goods_manage' */ '@/views/goods_manage/resource/index'),
            meta: {
                title: '资源管理',
                auth: ['goods_resource.browse']
            }
        }
    ]
}
